#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "Timer.h"
#include "Encoder.h"
#include "Timer.h"


int main(void)
{
	OLED_Init();
	Timer_Init();
	Encoder_Init();
	OLED_ShowString(1, 1, "CNT:");
	while (1)
	{

	}
}

void TIM2_IRQHandler(void)
{
    if (TIM_GetFlagStatus(TIM2, TIM_FLAG_Update) == SET)
    {
		OLED_ShowSignedNum(1, 5, Encoder_SpeedGet(), 5);
		TIM_SetCounter(TIM3, 0);
        TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
    }
}

